
/*************************************************************************************************

Replication code for

Walter, Stefanie (2021) "Brexit domino? The political contagion effects of 
voter-endorsed withdrawals from international institutions" Comparative Political Studies

January 2021

For questions, please contact 
Stefanie Walter, University of Zurich
walter@ipz.uzh.ch

*************************************************************************************************/


	
* ==============================================================================
* Section 4.	Brexit reverberations in the EU-27
* ==============================================================================

** Prepare exchange-rate graph (Figure 1, left-hand panel)
***********************************************************/
/* Average GBP exchange rate against four major currencies (EUR, USD, CHF; JY), relative to July 2017 rate
Data Source: OFX 
https://www.ofx.com/en-gb/forex-news/historical-exchange-rates/monthly-average-rates/
retrieved 4.9.2020
*/

clear
use "/Users/walter/Documents/Papers/2017.Disintegration/2019.Contagion/CPS/CPS.R1/XR_data.dta"

set scheme s1mono

label var xr "GBP exchange rate relative to July 2017"
label var date_nr "Date"
label def dates 1 "Jul 17" 6 "Dec 17" 12 "Jun 18" 18 "Dec 18" 24 "Jun 19" 30 "Dec 19"
label val date_nr dates
line  xr date_nr, xline(1, lpattern(dot) lcolor(gs9)) xline(6, lpattern(dot) lcolor(gs9)) ///
	xline(12, lpattern(dot) lcolor(gs9)) xline(18, lpattern(dot) lcolor(gs9)) ///
	xline(24, lpattern(dot) lcolor(gs9)) xline(30, lpattern(dot) lcolor(gs9)) ///
	 xlabel(1 "Jun 17"  6 "Dec 17"  12 "Jun 18"  18 "Dec 18"  24 "Jun 19"  30 "Dec 19", alternate) ///
	 xtitle("") ///
	title("GBP exchange rate") subtitle("against basket of currencies") name(xr, replace)

	
	
** Prepare cross-sectional EU-27 data
***********************************************************
	
clear
use "/Users/walter/Documents/Papers/2017.Disintegration/2019.Contagion/CPS/Replication/Walter.Contagion.Replication.dta"

svyset metauuid  [pweight = metaweight]
set scheme s1mono
set showbaselevels 	



* Recode variables
* ===================================================

* Label wave dummies
label var wave1 "Jul 17"
label var wave2 "Dec 17"
label var wave3 "Jun 18"
label var wave4 "Dec 18"
label var wave5 "Jun 19"
label var wave6 "Dec 19"

* Objective measure of Brexit experience: GBP exchange rate (for data source see above)
gen gbp_xr=1 // exchange rate of month in which survey was conducted
replace gbp_xr=1.031985621 if wave==2
replace gbp_xr=1.021664229 if wave==3
replace gbp_xr=0.985672552 if wave==4
replace gbp_xr=0.977406448 if wave==5
replace gbp_xr=1.015446437 if wave==6

gen gbp_xr3=1 // average exchange rate of three months survey was conducted (including survey months)
replace gbp_xr3=1.023249226 if wave==2
replace gbp_xr3=1.036640674 if wave==3
replace gbp_xr3=1.001812505 if wave==4
replace gbp_xr3=1.00020032 if wave==5
replace gbp_xr3=1.000375064 if wave==6

* Brexit effect on UK
/* Five years from now on, do you think Brexit will make the UK … ? 
- much better off
- somewhat better off
- neither better nor worse off
- somewhat worse off
- much worse off
- Don’t know
*/
gen ukbrexdk=ukbrexiteffect==0
label var ukbrexdk "Brexit effect on UK - Don't know/NA"
gen ukbrex04=ukbrexiteffect2-1
gen ukbrex01=ukbrex04/4

* Vote intention hypothetical exit referendum
/* If [YOUR COUNTRY] were to hold a referendum on leaving the EU today, how would you vote?
- I would definitely vote to remain in the EU
- I would probably vote to remain in the EU
- I would probably vote to leave the EU
- I would definitely vote to leave the EU
- Don’t know
*/

gen definiteleave=exitreferendum==1
gen certainremain=exitreferendum==4
gen revexitref=(exitreferendum2-5)*(-1)
label def revexitref 4 "definitely leave" 3 "probably leave" 2 "probably remain" 1 "definitely remain"
label val revexitref revexitref

gen leave_noDK=leave
replace leave_noDK=. if exitreferendum==5

* EU opinion
/* What is your opinion of the EU?
- Very positive
- Somewhat positive
- Neither negative nor positive
- Somewhat negative
- Very negative
*/
gen euop5=euopinion-1
replace euop5=. if euopinion==0
label def euop5 0 "very negative" 1 "somewhat negative" ///
	2 "Neither negative nor positive" 3 "somewhat positive" 4 "very positive"
label val euop5 euop5
label var euop5 "EU opinion"	

* Preferred future course for EU
/* Which statement best describes your views about the future of the European Union? 
- The EU should return some power to national governments.
- The division of power between national governments and the EU should remain as it is today.
- National governments should transfer more power to the EU.
- Don’t know
*/
gen futureeudk=futureeu
replace futureeudk=4 if futureeu==.
label def futureeudk 1 "more transfer nat > EU" 2 "keep current division of power" ///
	3 "return powers from EU > nat" 4 "EU reform: don't know"
label val futureeudk futureeudk

* Attention paid to Brexit
/* How much are you following the news on the process of the United Kingdom (UK) leaving the European Union (EU), also known as “Brexit”?
- A lot
- A little
- Not a lot
- Not at all */
gen brexitaware03=brexitaware-1
label def brexitaware03 0 "not at all" 1 "not a lot" 2 "a little" 3 "a lot"
label val brexitaware03 brexitaware03



* ====================================================================
**** Figure1: Over-time development of Brexit- and EU related opinion
* ====================================================================

* Graph: expected Brexit effect over time
svy: regress ukbrex01 wave1 wave2 wave3 wave4 wave5 wave6, noconst
estimates store ukbrex01

coefplot ukbrex01 , vertical ///
	ytitle("In 5 years, Brexit will make UK better off" " ") ///
	yscale(range(.4 .5)) ylab(.4 (.025) .5, grid) xlab(, alternate) ///
	title("Effect of Brexit on UK") subtitle(" ") ///
	legend(off) ///
	name(ukbrex, replace) 

* Graph: Hypothetical pro-exit vote over time
svy: regress leaver wave1 wave2 wave3 wave4 wave5 wave6, noconst 
estimates store leaver 

coefplot leaver , vertical ///
	ytitle("Hypothetical EU referendum: % probably/definitely Leave" " ") ///
	yscale(range(.175 .275)) ylab(.175 (.025).275, grid) xlab(, alternate) ///
	title("Support for EU-exit") subtitle(" ") ///
	legend(off) ///
	name(leave_graph, replace) 
	
* -------------------------------------------------------------------------
**** Figure 1: Over-time development XR and Brexit- and EU related opinion
* -------------------------------------------------------------------------
graph combine xr ukbrex leave_graph, col(3)	



* ====================================================================
**** Table 1: correlates of Brexit evaluations and Support for EU-exit
* ====================================================================
	
mixed ukbrex01  gbp_xr3 brexitaware03 euopinion i.futureeu age education female rural [pw=metaweight] || wave: || country: 
estimates store ukbrex_gbp3

mixed revexi  gbp_xr3 brexitaware03 euopinion i.futureeu age education female rural  [pw=metaweight] || wave: || country:
estimates store exit_gbp3

mixed revexi gbp_xr3 ib3.ukbrexiteffect2 brexitaware03 euopinion i.futureeu age education female rural  [pw=metaweight] || wave: || country:
estimates store exit_ukbrex

mixed ukbrex01  c.gbp_xr3##c.brexitaware03 euopinion i.futureeu age education female rural   [pw=metaweight] || wave: || country:
estimates store ukbrex_gbp3_att
margins, dydx(gbp_xr3) at(brexitaware03==(0(1)3)) post
marginsplot, title("Expected medium-term Brexit-effect on UK") yline(0) name(ukbrex_gbp3_att, replace)

mixed revexi c.gbp_xr3##c.brexitaware03 euopinion i.futureeu age education female rural   [pw=metaweight] || wave: || country:
estimates store exit_gbp3_att
margins, dydx(gbp_xr3) at(brexitaware03==(0(1)3)) post
marginsplot, title("Support for EU-exit") yline(0) name(exit_gbp3_att, replace)


* --------------------------------------------------------------------
*** Table 1: correlates of Brexit evaluations and Support for EU-exit
* ---------------------------------------------------------------------
estout  ukbrex_gbp3 exit_gbp3  exit_ukbrex  ukbrex_gbp3_att exit_gbp3_att, ///
	cells(b(star fmt(%9.3f)) se(par fmt(%9.2f))) style(fixed) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) stats(N ll aic) 


* -----------------------------------------------------------------------------------------
**** Figure 2: Marginal effect of Pound exchange-rate, conditional on attention to Brexit
* -----------------------------------------------------------------------------------------
graph combine ukbrex_gbp3_att exit_gbp3_att


	
* -----------------------------------------------------------------------------------------
*** Figure 3: Motivated reasoning - Interaction effects	Brexit evaluation * EU opinion
* -----------------------------------------------------------------------------------------
* DV: Vote intention exit referendum 	
mixed revexi gbp_xr3 ib3.ukbrexiteffect2##ib2.euop5 gbp_xr3 brexitaware03  i.futureeu age education female rural  [pw=metaweight] || wave: || country:
estimates store ukbrexit_euop5
margins, dydx(i1.ukbrexiteffect2) at(euop5==(0(1)4)) post 
estimates store mar_muchworse

estimates restore ukbrexit_euop5
margins, dydx(i2.ukbrexiteffect2) at(euop5==(0(1)4)) post 
estimates store mar_someworse

estimates restore ukbrexit_euop5
margins, dydx(i4.ukbrexiteffect2) at(euop5==(0(1)4)) post 
estimates store mar_somebetter

estimates restore ukbrexit_euop5
margins, dydx(i5.ukbrexiteffect2) at(euop5==(0(1)4)) post 
estimates store mar_muchbetter

* Figure 2: Marginal effect of Brexit on hypothetical EU-referendum vote
coefplot mar_muchworse  mar_someworse mar_somebetter mar_muchbetter, levels( 95 90) ///
		coeflabels(1._at = "EU very negative" 2._at = "EU  negative" ///
		3._at = "EU neither-nor" 4._at = "EU positive" 5._at = "EU very positive") ///
		legend(order(1 "Brexit makes the UK...      " 2 "   " ///
		3 "much worse off"  6 "somewhat worse off"  ///
		9 "somewhat better off" 12 "much better off"	 ) rows(3)) ///
		xline(0) ///
		name(conditionaleff_EUopinion, replace) 	

	
	
* ===========================================
*  Online Appendix
* ===========================================


*** Table A1: Sample sizes by country and wave
* ---------------------------------------------------------------
tab country wave

*** Table A2: Brexit effect on UK
* ---------------------------------------------
* Tab A2a: Brexit effect on UK
svy: tab ukbrexiteffect
* Tab A2b: support exit referendum Brexit effect on UK
svy: tab exitreferendum

*** Table A3: Descriptives
* ---------------------------------------------
sum  ukbrexiteffect2 ukbrex01 leaver gbp_xr3 exitreferendum2 brexitaware03 euopinion futureeu  age education female rural  


*** Table A4: Results from Fig 1 hold when sociodemographics are controlled for
* -------------------------------------------------------------------------------
mixed ukbrex01  wave2 wave3 wave4 wave5 wave6 age education female rural [pw=metaweight] || wave: || country: 
estimates store ukbrex01
mixed leaver  wave2 wave3 wave4 wave5 wave6 age education female rural [pw=metaweight] || wave: || country: 
 estimates store leaver

esttab ukbrex01 leaver, ///
	cells(b(star fmt(%9.3f)) se(par fmt(%9.2f))) style(fixed) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) stats(N ll aic) 

	
*** Table A5: correlates of Brexit evaluations without controlling for EU opinion
* -------------------------------------------------------------------------------
mixed revexi gbp_xr3 ib3.ukbrexiteffect2 brexitaware03 age education female rural  [pw=metaweight] || wave: || country:
estimates store exit_ukbrex

estout  exit_ukbrex, ///
	cells(b(star fmt(%9.3f)) se(par fmt(%9.2f))) style(fixed) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) stats(N ll aic) 

	

*** Table A6: Motivated reasoning: Results underlying Figure 3
* -------------------------------------------------------------------------------	
estout  ukbrexit_euop5, ///
	cells(b(star fmt(%9.3f)) se(par fmt(%9.2f))) style(fixed) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) stats(N ll aic) 
	
	
**** Figure A1: Spineplot EU opinion and Brexit evaluation
* -----------------------------------------------------------
corr brexitawareness euopinion
spineplot brexitawareness euopinion
	
**** Figure A2: Spineplot EU opinion and Brexit evaluation
* -----------------------------------------------------------
corr  ukbrexiteffect euopinion
spineplot  ukbrexiteffect euopinion

**** Figure A3: Brexit evaluations and support for EU exit
* -----------------------------------------------------------
corr  ukbrexiteffect revexit
spineplot  ukbrexiteffect revexit




* ==============================================================================
********* SWITZERLAND ANALYSIS:
** Section 5.	Brexit reverberations in Switzerland		
* ==============================================================================
*** Question wording is in German; for translation use for example www.deepl.com

clear
use "/Users/walter/Documents/Papers/2017.Disintegration/2019.Contagion/CPS/Replication/Walter.Contagion.CH.Replication.dta"

svyset id  [pweight = weight]
set scheme s1mono
set showbaselevels 	

* wave dummies
gen Mar19=Wave==1
gen Apr19=Wave==2
label def wave 0 "March 2019" 1 "April 2019"
label val Apr19 wave 

* Sociodemographics
gen female=sex==2
gen age=2019-birthyear
gen unemployed= employment==6
gen education=0
replace education= 1 if educ==2
replace education= 1 if educ==3
replace education= 2 if educ==4
replace education= 2 if educ==5
replace education= 2 if educ==6
replace education= 3 if educ==7
replace education= 3 if educ==8
replace education= 4 if educ==9
replace education= 4 if educ==10

* Brexit Attention
/* Wie stark verfolgen Sie die Nachrichten zum Austritt von Grossbritannien aus der Europäischen Union (EU), auch bekannt als „Brexit“?
- sehr stark
- stark
- mittelmässig
- wenig
- überhaupt nicht
*/
gen brexitattention=Brexit_Attention *(-1) +5
label def brexitattention 0 "none" 1 "little" 2 "some" 3 "high" 4 "very high"
label val brexitattention brexitattention
label var brexitattention "attention paid to Brexit"

gen att3=0
replace att3=1 if brexitattention>1
replace att3=2 if brexitattention>2
replace att3=. if brexitattention>4
label var att3 "Attention paid to Brexit"
label def att3 0 "low" 1 "medium" 2 "high"
label val att3 att3	
	
* Brexit Effect on UK
/* Wie schätzen Sie die Folgen ein, die der Brexit insgesamt in den nächsten 5 Jahren haben wird? Durch den Brexit wird es Grossbritannien...?"
- viel besser gehen
- etwas besser gehen
- weder besser noch schlechter gehen
- etwas schlechter gehen
- viel schlechter gehen
*/
gen ukbrexiteffect=Brexit_Conseq_GB*(-1) +5
label def brexiteffect 0 "a lot worse" 1 "somewhat worse" 2 "neutral" 3 "somewhat better" 4 "a lot better"
label val ukbrexiteffect brexiteffect
label var ukbrexiteffect "Expected effect of Brexit on UK"

* EU opinion
/* Wie bewerten Sie die EU insgesamt?
- sehr positiv
- eher positiv
- weder positiv noch negativ
- eher negativ
- sehr negativ
*/
gen euopinion=opinion_eu*(-1) +5
label def assessment 0 "v. neg" 1 "rather neg" 2 "neutral" 3 "rather pos" 4 "v. pos"
label val euopinion assessment
label var euopinion "assessment EU"

* Assessment bilateral treaties
/* Die bilateralen Verträge der Schweiz mit der EU sind...
- sehr positiv für die Schweiz
- eher positiv für die Schweiz
- weder positiv noch negativ für die Schweiz
- eher negativ für die Schweiz
- sehr negativ für die Schweiz
*/
gen bilaterals=(q7-5)*(-1)
label val bilaterals assessment
label var bilaterals "Assessment bilatreal treaties"

** party vote intention
/* Wenn am Sonntag Wahlen zum Schweizerischen Nationalrat wären, welche Partei würden Sie am ehesten wählen?
- SVP
- BDP
- FDP
- CVP
- SP
- Grüne
- Grünliberale 
- andere Partei
- würde nicht wählen
- weiss nicht
- keine Angabe
*/

gen svp=vote_intention==1
label var svp "SVP voter"
label def svp 0 "other party/abstain" 1 "SVP"
label val svp svp

* Labels referendum vote intentions
label def voteintention_anti 1 "certain against" 2 "probably against" 3 "probably for" 4 "certain for"
label def voteintention_pro 1 "certain for" 2 "probably for" 3 "probably against" 4 "certain against"


* Kündigung Bilaterale
/* Wenn es ein Referendum über die Kündigung der bilateralen Verträge zwischen der Schweiz und der EU geben würde, wie würden Sie stimmen?
- sicher für eine Kündigung
- eher für eine Kündigung
- eher gegen eine Kündigung
- sicher gegen eine Kündigung
- ich würde nicht stimmen gehen
*/
gen endbilaterals=(q8*(-1))+5
replace endbilaterals=. if q8==5
label var endbilaterals "Terminate bilateral treaties"
label val endbilaterals voteintention_anti

gen d_endbilaterals=q8<3
label var d_endbilaterals "Terminate bilaterals (dummy)"


* Referendum institutionelles Rahmenabkommen
/* Aktuell wird in der Schweiz über den Abschluss eines institutionellen Rahmenabkommens mit der EU diskutiert. Durch das Abkommen erhält die Schweiz weiterhin einen umfassenden Zugang zum EU-Binnenmarkt, muss dafür allerdings stärker als bis anhin EU-Recht übernehmen. 
Falls das Abkommen nicht zustande kommt, würde sich der Zugang der Schweiz zum EU-Binnenmarkt verschlechtern.
Wie werden Sie bei einem Referendum zum Rahmenabkommen stimmen?
- sicher für das Rahmenabkommen
- eher für das Rahmenabkommen
- eher gegen das Rahmenabkommen
- sicher gegen das Rahmenabkommen
- ich würde nicht stimmen gehen
*/
gen noInstA=q9
replace noInstA=. if q9==5
label var noInstA "Terminate bilateral treaties"
label val noInstA voteintention_pro

gen d_noInstA=q9>2
replace d_noInstA=0 if q9==5
label var d_noInstA "No to InstA (dummy)"


* Referendum Waffenrecht
/* Am 19. Mai wird in der Schweiz über die Reform des Waffengesetzes abgestimmt. Diese Reform setzt neues EU-Recht um, welches den Waffenbesitz stärker einschränkt als bisher.
Eine Ablehnung würde die Mitgliedschaft der Schweiz im Schengen-Abkommen gefährden. 
Wie werden Sie am 19. Mai stimmen?
- sicher für das neue Waffengesetz
- wahrscheinlich für das neue Waffengesetz
- wahrscheinlich gegen das neue Waffengesetz
- sicher gegen das neue Waffengesetz
- ich werde nicht stimmen gehen
*/
gen noweapons=q11
replace noweapons=. if q11==5
label var noweapons "No to weapons reform"
label val noweapons voteintention_pro

gen d_noweapons=q11>2
replace d_noweapons=0 if q11==5
label var d_noweapons "No to weapons reform (dummy)"


* Volksabstimmung Begrenzungsinitiative:
/* Die Volksinitiative "Für eine massvolle Zuwanderung (Begrenzungsinitiative)" verlangt, das Personenfreizügigkeitsabkommen mit der EU ausser Kraft zu setzen oder zu kündigen. 
Wie werden Sie bei einer Volksabstimmung über die Begrenzungsinitiative voraussichtlich stimmen?
- sicher für die Begrenzungsinitiative
- wahrscheinlich für die Begrenzungsinitiative
- wahrscheinlich gegen die Begrenzungsinitiative
- sicher gegen die Begrenzungsinitiative
- ich werde nicht stimmen gehen
*/

gen yeslimitation=(q13*(-1)+5)
replace yeslimitation=. if q13==5
label var yeslimitation "yes to Limitation initiative"
label val yeslimitation voteintention_anti

gen d_yeslimitation=q13<3
label var d_yeslimitation "yes to Limitation initiative (dummy)"


* -------------------------------------------------------
** Discussion in text
* -------------------------------------------------------

svy: tab ukbrex
svy: tab svp

* -------------------------------------------------------
*** Figure 4: Switzerland: Support for disintegration	
* -------------------------------------------------------
svy: regress d_endbilaterals Mar19 Apr19, noconst
estimates store endbilaterals
coefplot endbilaterals, vertical name(endbilaterals, replace) ///
	levels(95 90) xlab(, alternate) ///
	subtitle("Terminate" "bilateral treaties")

svy: regress d_yeslimitation Mar19 Apr19, noconst
estimates store yeslimitation
coefplot yeslimitation, vertical name(yeslimitation, replace) ///
	levels(95 90) xlab(, alternate)  ///
	subtitle("Support" "Limitation initiative")

svy: regress d_noInstA Mar19 Apr19, noconst
estimates store noInstA
coefplot noInstA, vertical name(noInstA, replace) ///
	levels(95 90) xlab(, alternate) ///
	subtitle("Against" "Framework Agreement")
	
svy: regress d_noweapons Mar19 Apr19, noconst
estimates store noweapons
coefplot noweapons, vertical name(noweapons, replace) ///
	levels(95 90) xlab(, alternate)  ///
	subtitle("Against" "weapons reform")

* -------------------------------------------------------
*** Figure 3: Switzerland: Support for disintegration	
* -------------------------------------------------------
graph combine noweapons yeslimitation noInstA endbilaterals  , ///
	cols(4) ycommon

	
* -------------------------------------------------------------------------------------
**** Tabe 2: Correlates of non-cooperative referendum vote intentions in Switzerland 
* -------------------------------------------------------------------------------------

svy: regress noweapons Apr19 ib2.ukbrex brexitatten euopinion svp  risk education age female unemployed i.Language
estimates store noweapons
svy: regress noInstA Apr19 ib2.ukbrex brexitatten euopinion svp  risk education age female unemployed i.Language
estimates store noInstA
svy: regress yeslimitation Apr19 ib2.ukbrex brexitatten euopinion svp risk education age female unemployed i.Language
estimates store yeslimitation
svy: regress endbilaterals Apr19 ib2.ukbrex brexitatten euopinion svp  risk education age female unemployed i.Language
estimates store endbilaterals

estout   noweapons  yeslimitation noInstA  endbilaterals , ///
	cells(b(star fmt(%9.3f)) se(par fmt(%9.2f))) style(fixed) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) stats(N r2 r2_a F) 
		



*** Mechanisms

* Attention
* ========================	
svy: regress endbilaterals Apr19##att3 svp  risk education age female unemployed i.Language
margins Apr19, dydx(att3)
margins att3, dydx(Apr19)
marginsplot, yline(0) title("Terminate bilateral treaties") level(90) ///
	recast(scatter) name(bila, replace)
estimates store att_endbilaterals

svy: regress d_yeslimitation Apr19##att3 svp  risk education age female unemployed i.Language
margins Apr19##att3
margins Apr19, dydx(att3)
margins att3, dydx(Apr19)
marginsplot, yline(0) title("For limitation initiative") level(90) ///
	recast(scatter) name(limitation, replace)
estimates store att_yeslimitation

svy: regress d_noInstA Apr19##att3 svp  risk education age female unemployed i.Language
margins Apr19, dydx(att3)
margins att3, dydx(Apr19)
marginsplot, yline(0) title("Against framework agreement") level(90) ///
	recast(scatter) name(insta, replace)
estimates store att_noInstA

svy: regress d_noweapons Apr19##att3 svp  risk education age female unemployed i.Language
margins Apr19, dydx(att3)
margins att3, dydx(Apr19)
marginsplot, yline(0) title("Against weapons reform") level(90) ///
	recast(scatter) name(weapon, replace)
estimates store att_noweapons

graph combine weapon  limitation insta bila, ycommon col(4) title("Informational mechanism") name(att, replace)

estout    att_noweapons att_yeslimitation att_noInstA  att_endbilaterals, ///
	cells(b(star fmt(%9.3f)) se(par fmt(%9.2f))) style(fixed) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) stats(N r2 F) 
	

* Motivated reasoning

svy: regress endbilaterals Apr19##svp att3  risk education age female unemployed i.Language
margins svp, dydx(Apr19)
marginsplot, yline(0) title("Terminate bilateral treaties") level(90) ///
	recast(scatter) name(bila, replace)
estimates store svp_endbilaterals

svy: regress d_yeslimitation Apr19##svp att3  risk education age female unemployed i.Language
margins svp, dydx(Apr19)
marginsplot, yline(0) title("For limitation initiative") level(90) ///
	recast(scatter) name(limitation, replace)
estimates store svp_yeslimitation

svy: regress d_noInstA Apr19##svp att3  risk education age female unemployed i.Language
margins svp, dydx(Apr19)
marginsplot, yline(0) title("Against framework agreement") level(90) ///
	recast(scatter) name(insta, replace)
estimates store svp_noInstA

svy: regress d_noweapons Apr19##svp att3  risk education age female unemployed i.Language
margins svp, dydx(Apr19)
marginsplot, yline(0) title("Against weapons reform") level(90) ///
	recast(scatter) name(weapon, replace)
estimates store svp_noweapons

estout   svp_noweapons svp_yeslimitation svp_noInstA  svp_endbilaterals, ///
	cells(b(star fmt(%9.3f)) se(par fmt(%9.2f))) style(fixed) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) stats(N r2 r2_a F) 	

* Graphs motivated reasoning
graph combine weapon  limitation insta bila, ycommon col(4) name(svp, replace) title("Motivated Reasoning mechanism")

* Combine mechanism graphs
graph combine att svp, row(2)	

	
* ===========================================
*  Online Appendix
* ===========================================


*** Table A1: Sample sizes by country and wave
* ---------------------------------------------------------------
	
sum endbilaterals yeslimitation noInstA noweapons Apr19 ukbrex brexitatten svp euopinion risk education age female unemployed i.Language		
	

**** Figure A3: Spineplot EU opinion and Brexit evaluation
* -----------------------------------------------------------
corr att3 euopinion
spineplot att3 euopinion
	
**** Figure A4a: Spineplot EU opinion and Brexit evaluation
* -----------------------------------------------------------
corr  ukbrexiteffect euopinion
spineplot  ukbrexiteffect euopinion


**** Figure A5: Brexit evaluations and support for SVP
* -----------------------------------------------------------
corr  ukbrexiteffect svp
spineplot  ukbrexiteffect svp

	
	
